require('./PageSelectmultiinfo.styl');
const { Icon, Group, Boxs, List } = SaltUI;
const { HBox, Box } = Boxs;
import { Control } from 'react-keeper'
const ui = require('clientConfig/util/jsapi/ui');
class Selectmultiinfo extends React.Component {

    constructor(props) {
        super(props);
        this.state = {
        };
        this.CHINA_PROVINCE_JSON = [
            { "code": "110000", "text": "北京" },
            { "code": "120000", "text": "天津" },
            { "code": "130000", "text": "河北" },
            { "code": "140000", "text": "山西" },
            { "code": "150000", "text": "内蒙古" },
            { "code": "210000", "text": "辽宁" },
            { "code": "220000", "text": "吉林" },
            { "code": "230000", "text": "黑龙江" },
            { "code": "310000", "text": "上海" },
            { "code": "320000", "text": "江苏" },
            { "code": "330000", "text": "浙江" },
            { "code": "340000", "text": "安徽" },
            { "code": "350000", "text": "福建" },
            { "code": "360000", "text": "江西" },
            { "code": "370000", "text": "山东" },
            { "code": "410000", "text": "河南" },
            { "code": "420000", "text": "湖北" },
            { "code": "430000", "text": "湖南" },
            { "code": "440000", "text": "广东" },
            { "code": "450000", "text": "广西" },
            { "code": "460000", "text": "海南" },
            { "code": "500000", "text": "重庆" },
            { "code": "510000", "text": "四川" },
            { "code": "520000", "text": "贵州" },
            { "code": "530000", "text": "云南" },
            { "code": "540000", "text": "西藏" },
            { "code": "610000", "text": "陕西" },
            { "code": "620000", "text": "甘肃" },
            { "code": "630000", "text": "青海" },
            { "code": "640000", "text": "宁夏" },
            { "code": "650000", "text": "新疆" }];



    }
    handleClick(event, dataItem) {
        //   alert(JSON.stringify(dataItem));
        let type = this.props.params.type;
        // debugger
        // alert("type="+type)
        Control.go('/bind/modify/selectInfo/' + parseInt(dataItem.code) + '/' + dataItem.text + '/' + type, { text: dataItem.text, type });
    }
    render() {
        return (
            <div className="selectmultiinfo">
                <List
                    layout="right"
                    hasRightIcon={true}
                    isDelete={false}
                    demoTitle=""
                    data={this.CHINA_PROVINCE_JSON}
                    onClick={this.handleClick.bind(this)}
                />
            </div>
        );
    }

    componentWillMount() {
        ui.setLeft({ control: true, text: '返回' }, (isSuccessed, result) => {
            let id = this.props.params.id;
            if (isSuccessed) {
                Control.go(-1, { id })
            }
            // let id = this.props.params.id;
            // let type = this.props.params.type;
            // // alert(id)
            // if (type == '1') {
            //     // alert(JSON.stringify({ id, content: this.state.name }))
            //     Control.go('/home', { id})
            // } else if (type == '0') {
            //     Control.go('/bind/modify', { id});
            // }
        })
    }

    componentDidMount() {
    }

    componentWillReceiveProps(nextProps) {
    }

    shouldComponentUpdate(nextProps, nextState) {
        return true;
    }

    componentWillUpdate(nextProps, nextState) {
    }

    componentDidUpdate(prevProps, prevState) {
    }

    componentWillUnmount() {
    }
}

module.exports = Selectmultiinfo;
